package com.hapzxb.thread.synchronizede;

/**
 * 对于静态同步方法，锁的当前类的class对象
 *
 * @Author: zhaoxb
 * @Date: 2019-04-09 21:36
 **/
public class Demo1Test3 {

    SynchronizedDemo1 x = new SynchronizedDemo1();
    SynchronizedDemo1 y = new SynchronizedDemo1();

    // 比较(01) x.isSyncA()与x.isSyncB()
    private void test1() {
        // 新建t11, t11会调用 x.isSyncA()
        Thread t11 = new Thread(SynchronizedDemo1::staticSynMethodA, "t11");

        // 新建t12, t12会调用 x.isSyncB()
        Thread t12 = new Thread(SynchronizedDemo1::staticSynMethodB, "t12");

        t11.start();  // 启动t11
        t12.start();  // 启动t12
    }

    public static void main(String[] args) {
        Demo1Test3 demo = new Demo1Test3();
        demo.test1();

        System.out.println(6500 - 6500 * 0.12 - 480);

//		Thread name;t11 ,staticSynMethodA....
//		Thread name;t11 ,staticSynMethodA....
//		Thread name;t11 ,staticSynMethodA....
//		Thread name;t11 ,staticSynMethodA....
//		Thread name;t11 ,staticSynMethodA....
//		Thread name;t12 ,staticSynMethodA....
//		Thread name;t12 ,staticSynMethodA....
//		Thread name;t12 ,staticSynMethodA....
//		Thread name;t12 ,staticSynMethodA....
//		Thread name;t12 ,staticSynMethodA....
    }
}
